﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/default.master" AutoEventWireup="true" CodeFile="MobileImages.aspx.cs" Inherits="admin_MobileImages" %>

<asp:Content ID="Content1" ContentPlaceHolderID="pnlMain" Runat="Server">

    <div class="createform">
        <div class="form-header">Synchonize Images to Mobile</div>
         <div class="form-horizontal">
            <div class="alert alert-block">Note: Any images under mobile folder will be replaced.</div>
            <div class="alert alert-error" id="divError" style="display:none;">Problem Encountered. Please contact administrator. <br /></div>
                
            <div class="control-group" id="divwait" style="display:none;">
                <div style="text-align:center; width:100%;">Images synchronization in progress. Please wait.... </div>
                <div class="progress progress-striped active" style="margin:0px auto 0px auto; width:50%;">
                <div class="bar" style="width:100%;"></div>
            </div>
            </div>
        </div>
        <div class="form-footer">
            <input type="button" value="Synchonize Images to Mobile" onclick="ProcessSynchronization()" class="btn" />
        </div>    
    </div>
        
    <script type="text/javascript">

            function ProcessSynchronization() {

                var answer = confirm("Are you sure you want to proceed?");

                if (!answer) return;

                $("#" + "divwait").show();

                $.ajax({
                    type: "POST",
                    url: "../StoreFrontService.asmx/SyncIseImagesToMobile",
                    success: function (result) {
                        $("#" + "divwait").hide();
                        alert('Images successfully synchronized!');
                    },
                    dataType: "json",
                    data: "",
                    error: function (result, textStatus, errorThrown) {
                        $("#" + "divwait").hide();
                        $("#" + "divError").show();
                        $("#" + "divError").append("<center><h3>" + errorThrown + "</h3>  </center>");
                    }
                });

            }

            
        </script>

</asp:Content>

